package cn.com.petrochina.lpm3.controller;


import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

//    @PostMapping("/login")
//    public ModelAndView login(
//            HttpServletRequest request,
//            HttpServletResponse response)
//            throws Exception {
//
//        String uiModuleId = request.getParameter("module");
//        String userName = request.getParameter("userName");
//        String url_my = request.getParameter("url_my");
//        String system = request.getParameter("system");
//
//        if ("HBIMPORT".equals(system)) {
//            if (url_my != null && !url_my.equals("")) {
//                response.setHeader("P3P", "CP=CAO PSA OUR");
//                //System.out.println(url_my);
//                String re = "@";
//                url_my = url_my.replace(re, "&");
//                String orgid = request.getParameter("Org_ID");
//                LPMLoginUser loginUser = new LPMLoginUser();
//                loginUser.setUserId(userName);
//                loginUser.setOrgId(orgid);
//                loginUser.setOrgName(orgid);
//                loginUser.setOrgLevel(30L);
//                request.getSession().setAttribute("loginUser", loginUser);
//                return new ActionForward(url_my, true);
//            }
//        }
//
//
//        ActionMessages errors = new ActionMessages();
//        if (uiModuleId == null || userName == null) {
//            return mapping.findForward("reject");
//        }
//        AppConfig appConfig = new AppConfig();
//        String oilFieldCode = (String) appConfig.input().get("oilFieldCode");
//        List list = mgr.getUserOrgFromPingTai(userName, oilFieldCode);
//        if (list == null || list.size() < 1) {
//            errors.add(ActionMessages.GLOBAL_MESSAGE,
//                    new ActionMessage("errors.loginuser.notfound"));
//            saveErrors(request, errors);
//
//            return mapping.findForward("error");
//        }
//        PcTwsOrgprivilege pto = new PcTwsOrgprivilege();
//        PcOrganization pcOrganization = new PcOrganization();
//        pcOrganization.setOrgId((String) list.get(0));
//
//        pto.setUserId(userName);
//        pto.setOrganization(pcOrganization);
//
//        if (list != null) {
//            if (list.size() > 1) {
//                errors.add(ActionMessages.GLOBAL_MESSAGE,
//                        new ActionMessage("errors.loginuser.notfound"));
//                saveErrors(request, errors);
//
//                return mapping.findForward("error");
//            } else {
//
//                PcTwsOrgprivilege pt = new PcTwsOrgprivilege();
//                pt.setUserId(userName);
//                pt.setOrganization(pcOrganization);
//                List pcTwsOrg = mgr.getTwsOrg(userName, (String) list.get(0));
//                if (pcTwsOrg.size() < 1) {
//                    //加到采集用户表中
//                    mgr.save(pto);
//
//                }
//            }
//        }
//        List orgnization = mgr.getPcOrganization((String) list.get(0));
//
//
//        if (orgnization.get(0) == null) {
//            errors.add(ActionMessages.GLOBAL_MESSAGE,
//                    new ActionMessage("errors.loginuser.orgname.notfound"));
//            saveErrors(request, errors);
//
//            return mapping.findForward("error");
//        }
//        if (orgnization.get(1) == null) {
//            errors.add(ActionMessages.GLOBAL_MESSAGE,
//                    new ActionMessage("errors.loginuser.orglevel.notfound"));
//            saveErrors(request, errors);
//
//            return mapping.findForward("error");
//        }
//
//        // 保存用户信息到到session中
//        LPMLoginUser loginUser = new LPMLoginUser();
//
//        List<Map> listOrgLevel10 = ps.selectList(" select ORG_ID from (select org_id,org_name ,org_level from pc_organization_t m  start with org_id = '" + (String) orgnization.get(0) + "' connect by prior m.parent_id=m.org_id) where org_level = 10");
//        List<Map> listOrgLevel20 = ps.selectList(" select ORG_ID from (select org_id,org_name ,org_level from pc_organization_t m  start with org_id = '" + (String) orgnization.get(0) + "' connect by prior m.parent_id=m.org_id) where org_level = 20");
//        loginUser.setUserId(userName);
//        loginUser.setOrgId((String) orgnization.get(0));
//        loginUser.setOrgName((String) orgnization.get(1));
//        loginUser.setOrgLevel((Long) orgnization.get(2));
//        request.getSession().setAttribute("loginUser", loginUser);
//        if (listOrgLevel10.size() > 0) {
//            System.out.println("rrrrrrrrr:" + listOrgLevel10.get(0).get("ORG_ID"));
//
//            request.getSession().setAttribute("orgLevel10", listOrgLevel10.get(0).get("ORG_ID"));
//            if (listOrgLevel20.size() > 0) {
//                request.getSession().setAttribute("orgLevel20", listOrgLevel20.get(0).get("ORG_ID"));
//            }
//
//            Locale locale = LocaleContextHolder.getLocale();
//            if (oilFieldCode.equals("dq") || oilFieldCode.equals("cq")) {
//
//                String orgId = null;
//                if (oilFieldCode.equals("cq")) {
//                    orgId = (String) listOrgLevel10.get(0).get("ORG_ID");
//                }
//                if (oilFieldCode.equals("dq")) {
//                    orgId = (String) orgnization.get(0);
//                }
//                List<Map> listRange = ps.selectList("select MIN_TUBING_PRES,MAX_TUBING_PRES,MIN_CASING_PRES,MAX_CASING_PRES,MIN_RE_TEMP,MAX_RE_TEMP,MIN_MIX_PRES,MAX_MIX_PRES,MIN_PRO_DENSITY,MAX_PRO_DENSITY,MIN_INJ_PUMP_PRES,MAX_INJ_PUMP_PRES," +
//                        "MIN_UP_CURRENT,MAX_UP_CURRENT, MIN_DOWN_CURRENT,MAX_DOWN_CURRENT,MIN_BACK_PRES,MAX_BACK_PRES," +
//                        "MIN_GAS_PROD_DAILY,MAX_GAS_PROD_DAILY,MIN_WATER_MIX_PRES,MAX_WATER_MIX_PRES," +
//                        "MIN_SHUT_CAS_PRES,MAX_SHUT_CAS_PRES,MIN_SHUT_THUT_PRES,MAX_SHUT_THUT_PRES," +
//                        "MIN_WH_TEMP,MAX_WH_TEMP,MAX_WATER_MIX_TEMP,MIN_WATER_MIX_TEMP," +
//                        "MIN_MAIN_LINE_PRES,MAX_MAIN_LINE_PRES,MIN_OVER_FLOW_VOL,MAX_OVER_FLOW_VOL," +
//                        "MIN_VALVE_PRES,MAX_VALVE_PRES,MIN_CHEM_VOL,MAX_CHEM_VOL," +
//                        "MIN_MLOVERFLOWVOL,MAX_MLOVERFLOWVOL,MIN_TUBING_PRES_W,MAX_TUBING_PRES_W," +
//                        "MIN_CASING_PRES_W,MAX_CASING_PRES_W,MIN_INJSURFACTANT,MAX_INJSURFACTANT," +
//                        "MIN_INJALKALI,MAX_INJALKALI,MAX_PUMPDIAMETER,MIN_PUMPDIAMETER from pc_lpm_range_config where p_id= ? ", new Object[]{orgId});
//
//                if (listRange.size() > 0) {
//                    request.getSession().setAttribute("MIN_TUBING_PRES", listRange.get(0).get("MIN_TUBING_PRES") == null ? "-10" : Double.parseDouble((String) listRange.get(0).get("MIN_TUBING_PRES")));
//                    request.getSession().setAttribute("MAX_TUBING_PRES", listRange.get(0).get("MAX_TUBING_PRES") == null ? "30" : Double.parseDouble((String) listRange.get(0).get("MAX_TUBING_PRES")));
//                    request.getSession().setAttribute("MIN_CASING_PRES", listRange.get(0).get("MIN_CASING_PRES") == null ? "-10" : Double.parseDouble((String) listRange.get(0).get("MIN_CASING_PRES")));
//                    request.getSession().setAttribute("MAX_CASING_PRES", listRange.get(0).get("MAX_CASING_PRES") == null ? "30" : Double.parseDouble((String) listRange.get(0).get("MAX_CASING_PRES")));
//                    request.getSession().setAttribute("MIN_INJ_PUMP_PRES", listRange.get(0).get("MIN_INJ_PUMP_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_INJ_PUMP_PRES")));
//                    request.getSession().setAttribute("MAX_INJ_PUMP_PRES", listRange.get(0).get("MAX_INJ_PUMP_PRES") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_INJ_PUMP_PRES")));
//                    request.getSession().setAttribute("MIN_MIX_PRES", listRange.get(0).get("MIN_MIX_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_MIX_PRES")));
//                    request.getSession().setAttribute("MAX_MIX_PRES", listRange.get(0).get("MAX_MIX_PRES") == null ? "4" : Double.parseDouble((String) listRange.get(0).get("MAX_MIX_PRES")));
//                    request.getSession().setAttribute("MIN_PRO_DENSITY", listRange.get(0).get("MIN_PRO_DENSITY") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_PRO_DENSITY")));
//                    request.getSession().setAttribute("MAX_PRO_DENSITY", listRange.get(0).get("MAX_PRO_DENSITY") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_PRO_DENSITY")));
//                    request.getSession().setAttribute("MIN_RE_TEMP", listRange.get(0).get("MIN_RE_TEMP") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_RE_TEMP")));
//                    request.getSession().setAttribute("MAX_RE_TEMP", listRange.get(0).get("MAX_RE_TEMP") == null ? "100" : Double.parseDouble((String) listRange.get(0).get("MAX_RE_TEMP")));
//
//
//                    request.getSession().setAttribute("MIN_UP_CURRENT", listRange.get(0).get("MIN_UP_CURRENT") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_UP_CURRENT")));
//                    request.getSession().setAttribute("MAX_UP_CURRENT", listRange.get(0).get("MAX_UP_CURRENT") == null ? "100" : Double.parseDouble((String) listRange.get(0).get("MAX_UP_CURRENT")));
//                    request.getSession().setAttribute("MIN_DOWN_CURRENT", listRange.get(0).get("MIN_DOWN_CURRENT") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_DOWN_CURRENT")));
//                    request.getSession().setAttribute("MAX_DOWN_CURRENT", listRange.get(0).get("MAX_DOWN_CURRENT") == null ? "100" : Double.parseDouble((String) listRange.get(0).get("MAX_DOWN_CURRENT")));
//                    request.getSession().setAttribute("MIN_BACK_PRES", listRange.get(0).get("MIN_BACK_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_BACK_PRES")));
//                    request.getSession().setAttribute("MAX_BACK_PRES", listRange.get(0).get("MAX_BACK_PRES") == null ? "100" : Double.parseDouble((String) listRange.get(0).get("MAX_BACK_PRES")));
//                    request.getSession().setAttribute("MIN_GAS_PROD_DAILY", listRange.get(0).get("MIN_GAS_PROD_DAILY") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_GAS_PROD_DAILY")));
//                    request.getSession().setAttribute("MAX_GAS_PROD_DAILY", listRange.get(0).get("MAX_GAS_PROD_DAILY") == null ? "999999" : Double.parseDouble((String) listRange.get(0).get("MAX_GAS_PROD_DAILY")));
//                    request.getSession().setAttribute("MIN_WATER_MIX_PRES", listRange.get(0).get("MIN_WATER_MIX_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_WATER_MIX_PRES")));
//                    request.getSession().setAttribute("MAX_WATER_MIX_PRES", listRange.get(0).get("MAX_WATER_MIX_PRES") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_WATER_MIX_PRES")));
//                    request.getSession().setAttribute("MIN_SHUT_CAS_PRES", listRange.get(0).get("MIN_SHUT_CAS_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_SHUT_CAS_PRES")));
//                    request.getSession().setAttribute("MAX_SHUT_CAS_PRES", listRange.get(0).get("MAX_SHUT_CAS_PRES") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_SHUT_CAS_PRES")));
//                    request.getSession().setAttribute("MIN_SHUT_THUT_PRES", listRange.get(0).get("MIN_SHUT_THUT_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_SHUT_THUT_PRES")));
//                    request.getSession().setAttribute("MAX_SHUT_THUT_PRES", listRange.get(0).get("MAX_SHUT_THUT_PRES") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_SHUT_THUT_PRES")));
//                    request.getSession().setAttribute("MIN_WH_TEMP", listRange.get(0).get("MIN_WH_TEMP") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_WH_TEMP")));
//                    request.getSession().setAttribute("MAX_WH_TEMP", listRange.get(0).get("MAX_WH_TEMP") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_WH_TEMP")));
//                    request.getSession().setAttribute("MIN_WATER_MIX_TEMP", listRange.get(0).get("MIN_WATER_MIX_TEMP") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_WATER_MIX_TEMP")));
//                    request.getSession().setAttribute("MAX_WATER_MIX_TEMP", listRange.get(0).get("MAX_WATER_MIX_TEMP") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_WATER_MIX_TEMP")));
//                    request.getSession().setAttribute("MIN_MAIN_LINE_PRES", listRange.get(0).get("MIN_MAIN_LINE_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_MAIN_LINE_PRES")));
//                    request.getSession().setAttribute("MAX_MAIN_LINE_PRES", listRange.get(0).get("MAX_MAIN_LINE_PRES") == null ? "30" : Double.parseDouble((String) listRange.get(0).get("MAX_MAIN_LINE_PRES")));
//                    request.getSession().setAttribute("MIN_OVER_FLOW_VOL", listRange.get(0).get("MIN_OVER_FLOW_VOL") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_OVER_FLOW_VOL")));
//                    request.getSession().setAttribute("MAX_OVER_FLOW_VOL", listRange.get(0).get("MAX_OVER_FLOW_VOL") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_OVER_FLOW_VOL")));
//                    request.getSession().setAttribute("MIN_VALVE_PRES", listRange.get(0).get("MIN_VALVE_PRES") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_VALVE_PRES")));
//                    request.getSession().setAttribute("MAX_VALVE_PRES", listRange.get(0).get("MAX_VALVE_PRES") == null ? "100" : Double.parseDouble((String) listRange.get(0).get("MAX_VALVE_PRES")));
//                    request.getSession().setAttribute("MIN_CHEM_VOL", listRange.get(0).get("MIN_CHEM_VOL") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_CHEM_VOL")));
//                    request.getSession().setAttribute("MAX_CHEM_VOL", listRange.get(0).get("MAX_CHEM_VOL") == null ? "300" : Double.parseDouble((String) listRange.get(0).get("MAX_CHEM_VOL")));
//                    request.getSession().setAttribute("MIN_MLOVERFLOWVOL", listRange.get(0).get("MIN_MLOVERFLOWVOL") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_MLOVERFLOWVOL")));
//                    request.getSession().setAttribute("MAX_MLOVERFLOWVOL", listRange.get(0).get("MAX_MLOVERFLOWVOL") == null ? "99999" : Double.parseDouble((String) listRange.get(0).get("MIN_MLOVERFLOWVOL")));
//                    request.getSession().setAttribute("MIN_TUBING_PRES_W", listRange.get(0).get("MIN_TUBING_PRES_W") == null ? "-10" : Double.parseDouble((String) listRange.get(0).get("MIN_TUBING_PRES_W")));
//                    request.getSession().setAttribute("MAX_TUBING_PRES_W", listRange.get(0).get("MAX_TUBING_PRES_W") == null ? "30" : Double.parseDouble((String) listRange.get(0).get("MAX_TUBING_PRES_W")));
//
//
//                    request.getSession().setAttribute("MIN_CASING_PRES_W", listRange.get(0).get("MIN_CASING_PRES_W") == null ? "-10" : Double.parseDouble((String) listRange.get(0).get("MIN_CASING_PRES_W")));
//                    request.getSession().setAttribute("MAX_CASING_PRES_W", listRange.get(0).get("MAX_CASING_PRES_W") == null ? "30" : Double.parseDouble((String) listRange.get(0).get("MAX_CASING_PRES_W")));
//                    request.getSession().setAttribute("MIN_INJSURFACTANT", listRange.get(0).get("MIN_INJSURFACTANT") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_INJSURFACTANT")));
//                    request.getSession().setAttribute("MAX_INJSURFACTANT", listRange.get(0).get("MAX_INJSURFACTANT") == null ? "99999" : Double.parseDouble((String) listRange.get(0).get("MAX_INJSURFACTANT")));
//                    request.getSession().setAttribute("MIN_INJALKALI", listRange.get(0).get("MIN_INJALKALI") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_INJALKALI")));
//                    request.getSession().setAttribute("MAX_INJALKALI", listRange.get(0).get("MAX_INJALKALI") == null ? "99999" : Double.parseDouble((String) listRange.get(0).get("MAx_INJALKALI")));
//
//                    request.getSession().setAttribute("MIN_PUMPDIAMETER", listRange.get(0).get("MIN_PUMPDIAMETER") == null ? "0" : Double.parseDouble((String) listRange.get(0).get("MIN_PUMPDIAMETER")));
//                    request.getSession().setAttribute("MAX_PUMPDIAMETER", listRange.get(0).get("MAX_PUMPDIAMETER") == null ? "100" : Double.parseDouble((String) listRange.get(0).get("MAX_PUMPDIAMETER")));
//
//                }
//                if (listRange.size() < 1) {
//                    request.getSession().setAttribute("MIN_TUBING_PRES", "-10");
//                    request.getSession().setAttribute("MAX_TUBING_PRES", "30");
//                    request.getSession().setAttribute("MIN_CASING_PRES", "-10");
//                    request.getSession().setAttribute("MAX_CASING_PRES", "30");
//                    request.getSession().setAttribute("MIN_INJ_PUMP_PRES", "0");
//                    request.getSession().setAttribute("MAX_INJ_PUMP_PRES", "300");
//                    request.getSession().setAttribute("MIN_MIX_PRES", "0");
//                    request.getSession().setAttribute("MAX_MIX_PRES", "4");
//                    request.getSession().setAttribute("MIN_PRO_DENSITY", "0");
//                    request.getSession().setAttribute("MAX_PRO_DENSITY", "300");
//                    request.getSession().setAttribute("MIN_RE_TEMP", "0");
//                    request.getSession().setAttribute("MAX_RE_TEMP", "300");
//
//                    request.getSession().setAttribute("MIN_UP_CURRENT", "0");
//                    request.getSession().setAttribute("MAX_UP_CURRENT", "100");
//                    request.getSession().setAttribute("MIN_DOWN_CURRENT", "0");
//                    request.getSession().setAttribute("MAX_DOWN_CURRENT", "100");
//                    request.getSession().setAttribute("MIN_BACK_PRES", "0");
//                    request.getSession().setAttribute("MAX_BACK_PRES", "100");
//                    request.getSession().setAttribute("MIN_GAS_PROD_DAILY", "0");
//                    request.getSession().setAttribute("MAX_GAS_PROD_DAILY", "999999");
//                    request.getSession().setAttribute("MIN_WATER_MIX_PRES", "0");
//                    request.getSession().setAttribute("MAX_WATER_MIX_PRES", "100");
//                    request.getSession().setAttribute("MIN_SHUT_CAS_PRES", "0");
//                    request.getSession().setAttribute("MAX_SHUT_CAS_PRES", "100");
//                    request.getSession().setAttribute("MIN_SHUT_THUT_PRES", "0");
//                    request.getSession().setAttribute("MAX_SHUT_THUT_PRES", "100");
//                    request.getSession().setAttribute("MIN_WH_TEMP", "0");
//                    request.getSession().setAttribute("MAX_WH_TEMP", "300");
//                    request.getSession().setAttribute("MIN_WATER_MIX_TEMP", "0");
//                    request.getSession().setAttribute("MAX_WATER_MIX_TEMP", "100");
//                    request.getSession().setAttribute("MIN_MAIN_LINE_PRES", "0");
//                    request.getSession().setAttribute("MAX_MAIN_LINE_PRES", "30");
//                    request.getSession().setAttribute("MIN_OVER_FLOW_VOL", "0");
//                    request.getSession().setAttribute("MAX_OVER_FLOW_VOL", "100");
//                    request.getSession().setAttribute("MIN_VALVE_PRES", "0");
//                    request.getSession().setAttribute("MAX_VALVE_PRES", "100");
//                    request.getSession().setAttribute("MIN_CHEM_VOL", "0");
//                    request.getSession().setAttribute("MAX_CHEM_VOL", "100");
//                    request.getSession().setAttribute("MIN_MLOVERFLOWVOL", "0");
//                    request.getSession().setAttribute("MAX_MLOVERFLOWVOL", "100");
//                    request.getSession().setAttribute("MIN_TUBING_PRES_W", "-10");
//                    request.getSession().setAttribute("MAX_TUBING_PRES_W", "30");
//
//
//                    request.getSession().setAttribute("MIN_CASING_PRES_W", "-10");
//                    request.getSession().setAttribute("MAX_CASING_PRES_W", "30");
//                    request.getSession().setAttribute("MIN_INJSURFACTANT", "0");
//                    request.getSession().setAttribute("MAX_INJSURFACTANT", "5000");
//                    request.getSession().setAttribute("MIN_INJALKALI", "0");
//                    request.getSession().setAttribute("MAX_INJALKALI", "5000");
//
//                    request.getSession().setAttribute("MIN_PUMPDIAMETER", "0");
//                    request.getSession().setAttribute("MAX_PUMPDIAMETER", "100");
//                }
//            } else {
//                request.getSession().setAttribute("MIN_TUBING_PRES", "-10");
//                request.getSession().setAttribute("MAX_TUBING_PRES", "30");
//                request.getSession().setAttribute("MIN_CASING_PRES", "-10");
//                request.getSession().setAttribute("MAX_CASING_PRES", "30");
//                request.getSession().setAttribute("MIN_INJ_PUMP_PRES", "0");
//                request.getSession().setAttribute("MAX_INJ_PUMP_PRES", "300");
//                request.getSession().setAttribute("MIN_MIX_PRES", "0");
//                request.getSession().setAttribute("MAX_MIX_PRES", "300");
//                request.getSession().setAttribute("MIN_PRO_DENSITY", "0");
//                request.getSession().setAttribute("MAX_PRO_DENSITY", "300");
//                request.getSession().setAttribute("MIN_RE_TEMP", "0");
//                request.getSession().setAttribute("MAX_RE_TEMP", "300");
//
//
//                request.getSession().setAttribute("MIN_UP_CURRENT", "0");
//                request.getSession().setAttribute("MAX_UP_CURRENT", "1000");
//                request.getSession().setAttribute("MIN_DOWN_CURRENT", "0");
//                request.getSession().setAttribute("MAX_DOWN_CURRENT", "100");
//                request.getSession().setAttribute("MIN_BACK_PRES", "0");
//                request.getSession().setAttribute("MAX_BACK_PRES", "50");
//                request.getSession().setAttribute("MIN_GAS_PROD_DAILY", "0");
//                request.getSession().setAttribute("MAX_GAS_PROD_DAILY", "999999");
//                request.getSession().setAttribute("MIN_WATER_MIX_PRES", "0");
//                request.getSession().setAttribute("MAX_WATER_MIX_PRES", "5000");
//                request.getSession().setAttribute("MIN_SHUT_CAS_PRES", "0");
//                request.getSession().setAttribute("MAX_SHUT_CAS_PRES", "100");
//                request.getSession().setAttribute("MIN_SHUT_THUT_PRES", "0");
//                request.getSession().setAttribute("MAX_SHUT_THUT_PRES", "100");
//                request.getSession().setAttribute("MIN_WH_TEMP", "0");
//                request.getSession().setAttribute("MAX_WH_TEMP", "100");
//                request.getSession().setAttribute("MIN_WATER_MIX_TEMP", "0");
//                request.getSession().setAttribute("MAX_WATER_MIX_TEMP", "300");
//                request.getSession().setAttribute("MIN_MAIN_LINE_PRES", "0");
//                request.getSession().setAttribute("MAX_MAIN_LINE_PRES", "30");
//                request.getSession().setAttribute("MIN_OVER_FLOW_VOL", "0");
//                request.getSession().setAttribute("MAX_OVER_FLOW_VOL", "1000");
//                request.getSession().setAttribute("MIN_VALVE_PRES", "0");
//                request.getSession().setAttribute("MAX_VALVE_PRES", "100");
//                request.getSession().setAttribute("MIN_CHEM_VOL", "0");
//                request.getSession().setAttribute("MAX_CHEM_VOL", "1000");
//                request.getSession().setAttribute("MIN_MLOVERFLOWVOL", "0");
//                request.getSession().setAttribute("MAX_MLOVERFLOWVOL", "1000");
//                request.getSession().setAttribute("MIN_TUBING_PRES_W", "0");
//                request.getSession().setAttribute("MAX_TUBING_PRES_W", "35");
//
//
//                request.getSession().setAttribute("MIN_CASING_PRES_W", "-10");
//                request.getSession().setAttribute("MAX_CASING_PRES_W", "30");
//                request.getSession().setAttribute("MIN_INJSURFACTANT", "0");
//                request.getSession().setAttribute("MAX_INJSURFACTANT", "5000");
//                request.getSession().setAttribute("MIN_INJALKALI", "0");
//                request.getSession().setAttribute("MAX_INJALKALI", "5000");
//
//                request.getSession().setAttribute("MIN_PUMPDIAMETER", "0");
//                request.getSession().setAttribute("MAX_PUMPDIAMETER", "100");
//            }
//        }
//
//        //读取油田配置信息
//
//        //报表ip端口
//        String rptUrl = (String) appConfig.input().get("rptUrl");
//        request.getSession().setAttribute("rptUrl", rptUrl);
//        //化验含水类型0是体积含水1是质量含水
//        String waterCutType = (String) appConfig.input().get("waterCutType");
//        request.getSession().setAttribute("waterCutType", waterCutType);
//
//        request.getSession().setAttribute("oilFieldCode", oilFieldCode);
//        //数据录入页面load模板
//        String loadTemplet = (String) appConfig.input().get("loadTemplet");
//        request.getSession().setAttribute("loadTemplet", loadTemplet);
//        String oilFieldCodeP = (String) appConfig.input().get("oilFieldCodeP");
//        request.getSession().setAttribute("oilFieldCodeP", oilFieldCodeP);
//        //关于常关井备注是否携带
//        String remark = (String) appConfig.input().get("remarks");
//        request.getSession().setAttribute("remark", remark);
//        //
//        String downtimeType = (String) appConfig.input().get("downtimeType");
//        request.getSession().setAttribute("downtimeType", downtimeType);
//        //长庆接口各厂IP
//        String f1 = (String) appConfig.input().get("f1");
//        String f2 = (String) appConfig.input().get("f2");
//        String f3 = (String) appConfig.input().get("f3");
//        String f4 = (String) appConfig.input().get("f4");
//        String f5 = (String) appConfig.input().get("f5");
//        String f6 = (String) appConfig.input().get("f6");
//        String f7 = (String) appConfig.input().get("f7");
//        String f8 = (String) appConfig.input().get("f8");
//        String f9 = (String) appConfig.input().get("f9");
//        String f10 = (String) appConfig.input().get("f10");
//        String f11 = (String) appConfig.input().get("f11");
//        String f12 = (String) appConfig.input().get("f12");
//        String f13 = (String) appConfig.input().get("f13");
//
//        request.getSession().setAttribute("f1", f1);
//        request.getSession().setAttribute("f2", f2);
//        request.getSession().setAttribute("f3", f3);
//        request.getSession().setAttribute("f4", f4);
//        request.getSession().setAttribute("f5", f5);
//        request.getSession().setAttribute("f6", f6);
//        request.getSession().setAttribute("f7", f7);
//        request.getSession().setAttribute("f8", f8);
//        request.getSession().setAttribute("f9", f9);
//        request.getSession().setAttribute("f10", f10);
//        request.getSession().setAttribute("f11", f11);
//        request.getSession().setAttribute("f12", f12);
//        request.getSession().setAttribute("f13", f13);
//        String orgIdf = (String) request.getSession().getAttribute("orgLevel10");
//
//        if ("rpBEjP8prn".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f1);
//        }
//        if ("SVfejIOLc2".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f2);
//        }
//        if ("SVfejIOuc3".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f3);
//        }
//        if ("SVfejIOuc4".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f4);
//        }
//        if ("SVfejIOLc5".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f5);
//        }
//        if ("SVfejIOdc6".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f6);
//        }
//        if ("SVfejIOLK7".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f7);
//        }
//        if ("SVfejICHZH".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f8);
//        }
//        if ("fUdEkGil7f".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f9);
//        }
//        if ("QRV8aNTPnF".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f10);
//        }
//        if ("fmQQDl3OD4".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f11);
//        }
//        if ("O0HI4Ip6R6".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", f12);
//        }
//        if ("CQXTbLYsNb".equals(orgIdf)) {
//            request.getSession().setAttribute("fIp", "10.78.7.190");
//        }
//
//        PcLpmUiModule uiModule = mgr.getPcLpmUiModule(uiModuleId);
//        if (url_my != null && !url_my.equals("")) {
//            response.setHeader("P3P", "CP=CAO PSA OUR");
//            //System.out.println(url_my);
//            String re = "@";
//            url_my = url_my.replace(re, "&");
//            return new ActionForward(url_my, true);
//        }
//        if (uiModule == null) {
//            errors.add(ActionMessages.GLOBAL_MESSAGE,
//                    new ActionMessage("errors.loginuser.module.notfound"));
//            saveErrors(request, errors);
//
//            return mapping.findForward("error");
//        }
//
//        // 重定向到结果页面
//        StringBuffer requestURL = request.getRequestURL();
//        String requestURI = request.getRequestURI();
//        String localPort = ":" + request.getLocalPort();
//        String contextPath = request.getContextPath();
//
//        StringBuffer path = new StringBuffer();
//        path.append(requestURL.replace(requestURL.length() - requestURI.length(),
//                requestURL.length(), ""));
//        if (path.lastIndexOf(localPort) == -1) {
//            path.append(localPort);
//        }
//        path.append(contextPath);
//
//        String uiUrl = uiModule.getUiUrl();
//        path.append(uiUrl.startsWith("/") ? uiUrl : "/" + uiUrl);
//
//        response.setHeader("P3P", "CP=CAO PSA OUR");
//
//        System.out.println(path);
//
//        return new ActionForward(path.toString(), true);
//    }
}
